//类对象的指针变量和类函数的指针变量的实训
//Training of pointer variables of class objects and pointer variables of class functions

// NOLINTBEGIN

#include <iostream>
using namespace std;
class Time {
 public:
  Time(int x, int y, int z) : hour(x), minute(y), second(z) {}
  void display() {
    cout << hour << ":" << minute << ":" << second << endl;
  }

 private:
  int hour;
  int minute;
  int second;
};

int main() {
  Time t1(11, 45, 14);
  Time* p;
  p = &t1;
  (*p).display();

  void (Time::*p1)();  //Time类的函数指针变量 A function pointer variable of the Time class
  p1 = &Time::
           display;  //把类公共的函数（方法）（类里的公共函数名） Class public function (method) (public function name in the class)
  (t1.*p1)();        //
  t1.display();//STAR:importance
  //system("pause");
  return 0;
}
// NOLINTEND